
const state = {
    isLogin: false
}

const mutations = {
    login(state) {
        state.isLogin = true
    },
    logout(state){
        state.isLogin = false
    }
}

const actions = {
    login({commit}) {
        commit('login')
    },
    logout({commit}){
        commit('logout')
    }
}

// 导出
export default {
    namespaced: true,  // 开启命名空间 https://vuex.vuejs.org/zh/guide/modules.html
    state,
    actions,
    mutations
}